The present invention relates to a tone generating method and device which permit a tone to be formed by a general-purpose processor having a computing unit.
The present invention also relates to a tone generating method which forms a tone waveform by executing a tone generating program on a programmable computing unit such as a CPU or DSP.
Conventionally known tone generating devices in general comprise a MIDI (Musical Instrument Digital Interface), a performance input section for receiving performance information from a keyboard or sequencer, a tone generator section for forming a tone waveform, and a microprocessor or central processing unit (CPU) for controlling the tone generator section in accordance with the input performance information. The CPU performs tone generator driver processing (performance processing) such as assignment of each tone to a selected channel (channel assignment) and parameter conversion in accordance with the input performance information, and supplies the converted parameters and a tone generating instruction (note-on signal) to the channel assigned by the tone generator section. The tone generator section is implemented by an electronic circuit such as an LSI (Large Scale Integrated Circuit) and forms a tone waveform on the basis of the supplied parameters.
However, the known tone generating devices were dedicated to tone generation purposes, and it was absolutely necessary in the past to employ such a dedicated tone generating device in order to generate tones.
For a solution to the problem, an improved tone generating device has been proposed, in which the CPU executes a specific application program to generate tones on the basis of the application program. This tone generating device can be implemented by a general-purpose computing unit which can perform tone generating and other functions by executing not only the tone generating application program but also other application programs. A general-purpose computer such as a personal computer can be employed as the hardware of such a tone generating device, which executes a tone generator program for tone generating operations. In this way, a so-call "software tone generator" is provided by the general-purpose computer.
In cases in which tones are generated by executing an application program on a general-purpose device having a computing unit (CPU), it has been customary that tone waveform samples are formed for individual tone generating channels every sampling cycle (i.e., conversion timing of a D/A converter employed). Thus, when the CPU executes necessary operations for each of the tone generating channels, some preparatory operations are performed by the CPU, such as reading, into the CPU registers, of various registers' values used in the last calculations for the channel. Also, after termination of tone generating processing for the channel, it is necessary to write the CPU registers' values into a memory for the next execution of the processing.
However, because the tone waveform sample forming or calculating process is performed sample by sample in each of the tone generating channels, the conventional software tone generator would present a problem that much of the CPU's calculating time is spent on the preparatory operations rather than the tone generating process (resulting in increased overheads), so that the calculating efficiency and response and tone forming speed of the tone generator would be undesirably lowered. That is, in performing the tone waveform sample forming process for the individual tone generating channels every sampling cycle, it is necessary for the CPU to cause the various data used in the previous calculations for the channels to be restored from the memory to the above-mentioned registers and also, after termination of the waveform forming calculations, cause the registers' stored contents to be saved into the memory for next execution of the process. Thus, much processing time is required for operations other than the primary waveform forming calculations.
Further, in the known tone generating methods where the CPU performs both the tone generator processing and the performance processing, the "performance processing" is one for creating control information for controlling tones to be generated on the basis of input performance information, and the "tone generator processing" is one for forming waveform data on the basis of the created control information. For example, the CPU normally executes the performance processing such as detection of depressed keys while it executes the tone generator processing every sampling cycle in response to an interrupt signal. After formation of waveform data is completed for one sample in the tone generator processing, the CPU reverts to the performance processing.
The performance information (MIDI event information) is generated by a player's performance operation or reproduction of an event via a sequencer, and the generated performance information is processed in the performance processing. Namely, whenever such performance information is generated, the CPU must execute the performance processing in addition to the normal tone generator processing; thus, non-periodic generation of the performance information would lead to a temporary increase in the calculating amounts. However, according to the known tone generating methods which are not arranged to properly deal with such a temporary increase in the calculating amounts, the tone generator processing is preferentially executed in a periodic fashion irrespective of whether performance information has been input or not, so that the performance processing would sometimes be delayed appreciably.
The delay in the performance processing may be avoided by raising the priority of the performance processing; however, in such a case, the operation of the tone generator processing would become instable, causing the number of simultaneously generated tones to be temporarily reduced or a tone waveform to be broken off.